/**
 * Created by Freeman on 2016/8/12.
 */
import React, {Component, PropTypes} from 'react'
import './css/main.css'
import Toolbar from './Toolbar'
class Main extends Component {
    constructor(props) {
        super(props)
    }

    render() {
        const {title,content,changeTitle,changeContent,publishArticle} = this.props;
        return (
            <div className="col-lg-6 main">
                <form className="note-form markdown" >
                    <input className="title mousetrap" name="note_name" type="text" id="note_title" defaultValue={title} onChange={changeTitle} />
                    <Toolbar isPublishing={false} publishArticle={publishArticle}/>
                    <textarea className="text mousetrap" name="note_content" style={{height: 885 +'px'}} defaultValue={content} onChange={changeContent} ></textarea>
                </form>
            </div>
        )
    }
}
Main.propTypes = {
    title:PropTypes.string.isRequired,
    content:PropTypes.string.isRequired,
    changeTitle:PropTypes.func.isRequired,
    changeContent:PropTypes.func.isRequired,
    publishArticle:PropTypes.func.isRequired
};

export default Main